package com.bee2c.zas.home.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.bee2c.zas.entity.FbpManagementBody;
import com.bee2c.zas.home.dao.FbpManagementBodyDao;

@RestController
@RequestMapping("/mb")
public class BodyController {

	@Autowired
	private FbpManagementBodyDao bodyDao;

	@RequestMapping("/findByBodyId/{bodyId}")
	public FbpManagementBody findByBodyId(@PathVariable("bodyId") Long bodyId) {
		return bodyDao.findByManagementBodyId(bodyId);
	}

	@RequestMapping("/findListByCon")
	public List<FbpManagementBody> findListByCon(@PathVariable("con") FbpManagementBody con) {
		return bodyDao.findListByCon(con);
	}

	@RequestMapping("/findPageByCon")
	public Page<FbpManagementBody> findPageByCon(@PathVariable("con") FbpManagementBody con,
			@PathVariable("pageIndex") int pageIndex, @PathVariable("pageSize") int pageSize) {
		return bodyDao.findPageByCon(con, pageIndex, pageSize);
	}
}
